package ru.study.thinkin.chapter14;

interface HasColor {
	java.awt.Color getColor() ; 
}

interface Weight {
	int weight();
}

class Colored <T extends HasColor> {
	T item;
	Colored(T item) {
		this.item=item;
	}
	T getItem() {
		return item;
	}
	
	java.awt.Color color() {
		return item.getColor();
	}
}

class Dimension {
	public int x,y,z;
}

class ColoredDimension<T extends Dimension & HasColor> {
	T item;
	ColoredDimension(T item) {
		this.item=item;
	}
	public T getItem() {
		return item;
	}
	java.awt.Color color() {
		return item.getColor();
	}
	int getX() { return item.x; }
}

class Solid <T extends Dimension & HasColor & Weight> {
	T item;

	public Solid(T item) {
		this.item = item;
	}

	public T getItem() {
		return item;
	}
	java.awt.Color  color() {
		return item.getColor();
	}
	int getX() { return item.x; }
}

class Bounded extends Dimension implements HasColor,Weight {
	public java.awt.Color getColor() {
		return null;
	}

	@Override
	public int weight() {		
		return 0;
	}
}

public class BasicBounds {
	
	public static void main(String[] args) {
		Solid<Bounded>solid = new Solid<Bounded>(new Bounded());
		solid.color();
	}
}
